<template>
	<div class="mainContent">
		<pathTracking :path='Model.path' />
		<div class="container">
			<div class="bgWhite bgRadius">
				<card :configArr="Model.configArr"></card>
				<el-row>
					<div class="common-table-title">
						<div class="common-table-icon"></div>
						<div class="common-table-fl">查询条件</div>
					</div>
				</el-row>
				<!-- 高级搜索 -->
				<advancedSearch :option="Model.filterOption" @getChild="getFilterData" @onSearch="onFilterSearch" @onClear="onFilterClear"
				 @onExport="onFilterExport"></advancedSearch>
			</div>
			<!-- 表格 -->
			<div class="table">
				<el-row>
					<div class="common-table-title">
						<div class="common-table-icon"></div>
						<div class="common-table-fl">
							<span>售后入库列表</span>
						</div>
						<div class="common-btn-group">
							<div class="common-table-btn-item" @click="onTableExport">导出</div>
						</div>
					</div>
				</el-row>
				<el-table :data="Model.tableData" border style="width: 100%;"  @selection-change="onTableSelectionChange">
					<el-table-column type="selection" width="50" fixed></el-table-column>
					<el-table-column prop="number" label="售后入库单号" width="150">
						<template slot-scope="scope">
							<el-button type="text" @click="toTableDetail(scope.row,true)">{{scope.row.number}}</el-button>
						</template>
					</el-table-column>
					<el-table-column prop="typeDict.value" label="入库单类型" width="120"></el-table-column>
					<el-table-column prop="saleNumber" label="售后订单" width="200"></el-table-column>
					<el-table-column prop="customerId" label="顾客ID" width="120"></el-table-column>
					<el-table-column prop="manName" label="顾客姓名" width="120"></el-table-column>
					<el-table-column prop="mobile" label="联系方式" width="120"></el-table-column>
					<el-table-column prop="exclusiveCode" label="专属编码" width="120"></el-table-column>
					<el-table-column prop="logisticsNumber" label="物流公司" width="120"></el-table-column>
					<el-table-column prop="logisticsCompany" label="物流单号" width="120"></el-table-column>
					<el-table-column prop="inWarehouseId" label="入库仓库" width="120"></el-table-column>
					<el-table-column prop="statusDict.value" label="入库单状态" width="120"></el-table-column>
					<el-table-column prop="createBy" label="创建人" width="120"></el-table-column>
					<el-table-column prop="createTime" label="创建时间" width="200"></el-table-column>
					<el-table-column prop="updateBy" label="操作人" width="120"></el-table-column>
					<el-table-column prop="sureTime" label="入库时间" width="200"></el-table-column>
					<el-table-column fixed="right" label="操作" width="120">
						<template slot-scope="scope">
							<div class="btnGroup">
								<div class="operate-btn" v-if="scope.row.status == 10" @click="toTableDetail(scope.row,false)">入库</div>
							</div>
						</template>
					</el-table-column>
				</el-table>
			</div>
			<!-- 分页 -->
			<el-row class="pagination-cont">
				<el-pagination @size-change="onTableSizeChange" background @current-change="onTableCurrentChange" :current-page="Model.pager.params.pageIndex"
				 :page-sizes="Model.pager.pageSizeArr" :pager-count="5" :page-size="Model.pager.params.pageSize" layout="total, sizes, prev, pager, next, jumper"
				 :total="Model.pager.pageTotal"></el-pagination>
			</el-row>
		</div>
	</div>
</template>

<script>
	import pathTracking from '@/components/common/pathTracking'
	import pagination from "@/components/common/pagination.vue";
	import card from '@/components/common/filterBtns';
	import advancedSearch from "@/components/common/filter/advancedSearch";

	import Model from './model.js'
	import Controller from './controller.js'
	export default {
		name: "purchase",
		mixins: [Model, Controller],
		components: {
			advancedSearch,
			pagination,
			pathTracking,
			card
		},
	};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less">
	@import "./index.less";
</style>
